<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:shiro="http://shiro.apache.org/tags">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Login</title>
        <h:outputStylesheet library="css" name="login.css"/>
        <h:outputScript library="js" name="jquery.min.js"/>
        <!-- 
        
                                                                $("#message").html('<p class="success">You have logged in successfully!</p><p>Redirecting....</p>');
        
                                                        $("#message").html('<p class="error">ERROR: Invalid username and/or password.</p>');
        -->

    </h:head>
    <body>
        <div class="lg-container">
            <h1>登陆</h1>
            <shiro:notAuthenticated>
                <h:form  id="lg-form">

                    <div>
                        <label for="lg-form:username">用户名:</label>
                        <h:inputText id="username" value="#{shiroMB.username}"/> 
                    </div>

                    <div>
                        <label for="lg-form:password">密码:</label>
                        <h:inputSecret id="password" value="#{shiroMB.password}"  />
                    </div>

                    <div id="lg-bt">	
                        <h:commandButton  action="#{shiroMB.login}"  value="登陆"/>

                    </div>

                </h:form>
                <div id="message"><p class="error">#{flash.loginfail}</p></div>
                <!--<a href="http://webscan.360.cn/index/checkwebsite/url/www.mumujiang.cn" name="017c02dc8276ad2149ec17f3b7edaa29" >360网站安全检测平台</a>-->
            </shiro:notAuthenticated>
            <shiro:authenticated>
                <h:form  id="lg-form">

                    <div>
                        <div id="message">用户<span class="error">#{shiroMB.username}</span>已登录!</div>


                    </div>
                    <div id="lg-bt">	
                        <h:commandButton  action="#{shiroMB.redirectIndexUrl}"  value="跳转"/>
                        <h:commandButton  action="#{shiroMB.logout}"  value="注销"/>
                    </div>

                </h:form>
                <div id="message"><p class="error">#{flash.loginfail}</p></div>
                <a href="http://webscan.360.cn/index/checkwebsite/url/www.mumujiang.cn" name="017c02dc8276ad2149ec17f3b7edaa29" >360网站安全检测平台</a>
            </shiro:authenticated>
        </div>
    </body>
</html>

